package com.xiaoxin.experience.common;

import com.xiaoxin.experience.util.StringUtil;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @author xiaoxin
 */
@Setter
@Getter
public class Property implements Serializable
{
    private static final long serialVersionUID = -5243164523105434433L;

    private String key;

    private String value;

    public Property() {}

    public Property(String key, String value)
    {
        this.key = key;
        this.value = value;
    }

    public boolean isValid()
    {
        return StringUtil.isNotBlank(key) && StringUtils.isNotBlank(value);
    }

    @Override
    public String toString()
    {
        return "Property{" +
                "key='" + key + '\'' +
                ", value='" + value + '\'' +
                '}';
    }
}
